<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <input type="text" v-model="obj.a">
    {{obj.a}}
    <hr>
    <input type="text" v-model="obj.b">
    {{obj.b}}
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          obj: {
            a: 'a',
            b: 'b'
          }
        }
      },
      watch: {
        /* obj: {
          handler(newVal) {
            console.log('obj改变了值是', newVal);
          },
          deep: true
        } */
        "obj.a"(newVal){
          console.log('obj的a属性变化了值是', newVal);
        }
      }
    })
    app.mount('#app')
  </script>
</body>
</html>